<template>
  <div id="head">
    <div class="width-100 bg-c-013 head-logo-box">
      <div class="container fix">
        <div class="flo-left">
          <img src="../assets/logo.png" alt="" class="cup" @click="backIndex">
        </div>
        <div class="flo-right">
          <button>{{typeFn}}</button>
          <button @click="loginOut" v-show="this.$store.state.isLawyerLogin||this.$store.state.isLawfirmLogin">退出系统</button>
        </div>
      </div>
    </div>
  </div>
</template>
<script type="text/javascript">
export default {
  methods: {
    loginOut() {
      this.$store.dispatch('getLoginOut').then(data => {
        this.$router.push('/')
        if (data.data.httpCode === 200) {

        } else {}
      }, err => {
        console.log(err)
      })
    },
    backIndex() {
      if (this.$store.state.isLawyerLogin) {
        this.$router.push('/welcome')
      }
      if (this.$store.state.isLawfirmLogin) {
        this.$router.push('/welcomelawfirm')
      }
      if (!this.$store.state.isLawfirmLogin && !this.$store.state.isLawyerLogin) {
        this.$router.push('/')
      }
    }
  },
  computed: {
    typeFn() {
      return this.$store.state.lawyerLoginData.lawyerName || this.$store.state.lawfirmLoginData.lawyerfirmName
    }
  }
}

</script>
<style type="text/css" scoped>
.head-logo-box .flo-right {
  margin-right: 24px;
  line-height: 40px;
}

.head-logo-box .flo-right button {
  color: #fff;
}

.head-logo-box {
  padding: 11px 0;
}

.head-logo-box .flo-left img {
  width: 259px;
  height: 38px;
}

input::-webkit-input-placeholder {
  color: #fff;
}

</style>
